package com.medvalley.tcm.dao;

import com.medvalley.tcm.domain.SickInfo;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.CrudRepository;

import java.util.Date;
import java.util.List;

public interface SickInfoDao extends CrudRepository<SickInfo, Long>, JpaSpecificationExecutor<SickInfo> {

    SickInfo findOneByBarCode(String barCode);

    List<SickInfo> findAllByPatientCardNum(String patientCardNum);

    List<SickInfo> findAllByPatientPhone(String patientPhone);

    List<SickInfo> findAllByIdIn(List<Long> ids);

    List<SickInfo> findAllByCreateTimeBetweenAndDiagnosticMechanismName(Date begin, Date end, String name);

    List<SickInfo> findAllByCreateTimeBetween(Date begin, Date end);

}
